package com.appstore.service.impl;

import com.appstore.domain.entity.App;
import com.appstore.mapper.AppMapper;
import com.appstore.service.IDevAppService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DevAppServiceImpl implements IDevAppService {

    @Autowired
    private AppMapper appMapper;

    /**
     * 查询应用详情
     *
     * @param id 应用详情主键
     * @return 应用详情
     */
    @Override
    public App selectAppById(Long id)
    {
        return appMapper.getAppById(id);
    }

    /**
     * 查询应用详情列表
     *
     * @param app 应用详情
     * @return 应用详情
     */
    @Override
    public List<App> selectAppList(App app)
    {
        return appMapper.selectAppList(app);
    }

    @Override
    public List<App> selectAppListByCondition(App app) {
        return appMapper.getAppByConditions(app);
    }

    /**
     * 新增应用详情
     *
     * @param app 应用详情
     * @return 结果
     */
    @Override
    public int insertApp(App app)
    {
        return appMapper.insertApp(app);
    }

    /**
     * 修改应用详情
     *
     * @param app 应用详情
     * @return 结果
     */
    @Override
    public int updateApp(App app)
    {
        return appMapper.updateApp(app);
    }

    /**
     * 批量删除应用详情
     *
     * @param ids 需要删除的应用详情主键
     * @return 结果
     */
    @Override
    public int deleteAppByIds(Long[] ids)
    {
        return appMapper.deleteAppByIds(ids);
    }

    /**
     * 删除应用详情信息
     *
     * @param id 应用详情主键
     * @return 结果
     */
    @Override
    public int deleteAppById(Long id)
    {
        return appMapper.deleteAppById(id);
    }
}

